package com.zsgeek.wisdchain.qutu.tools;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * @author 王亨彬
 * @date 2018/10/5
 * email：793325917@qq.com
 */
public class NetUtils {
    public static final int CountDownTimerMillisInFuture = 60 * 1000;

    public static boolean hasNetwork(Context context) {
        if (context != null) {
            ConnectivityManager connectivityManager = (ConnectivityManager) context
                    .getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
            if (networkInfo != null) {
                return networkInfo.isAvailable();
            }
            return false;
        }
        return false;
    }
}
